package day006.api_gui.itheima02;

import javax.swing.*;

public class JButtonDemo {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setTitle("JFRame添加按钮");
        jf.setSize(400, 300);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setAlwaysOnTop(true);
        jf.setLayout(null);

        JButton jb1 = new JButton("按钮1");
        jb1.setBounds(100, 100, 100, 20);
        JButton jb2 = new JButton("按钮2");
        jb2.setBounds(100, 120, 100, 20);

        jf.add(jb1);
        jf.add(jb2);

        jf.setVisible(true);


    }
}
